package com.viphome.classLoader;

/**
 * Created by wangzhanjin on 2017/12/25.
 */
public class MyClassLoader extends ClassLoader{

    //要加载的Java的classpath路径
    private String classPath;

    public MyClassLoader(String classPath){
        super(ClassLoader.getSystemClassLoader());
        this.classPath = classPath;
    }

    @Override
    protected Class<?> findClass(String name) throws ClassNotFoundException {
//        不用父类的findClass方法
        return super.findClass(name);
//        byte[] data = this.loadClass(name);
//        return this.defineClass(name,data,0,data.length)
    }
}
